package cn.le.InternalClass;

/**
 * Created by admin on 2017/5/9.
 * 类在创建第一个对象或调用static时加载类，如果有其基类，会继续加载其基类
 *
 */
public class Insect {

    private int i = 9;
    protected int j ;

    Insect(){
        j = 39;
    }

    private static int x1 = printInit("xxxxxxxx");
    static int printInit(String s)
    {
        return 47;
    }
}
class Beetle extends Insect{

    private int k = printInit("Beetle");

    public Beetle()
    {
        System.out.println("k="+k);
        System.out.println("j="+j);
    }

    private static int x2 = printInit("Beetle.x2");

    public static void main(String[] args) {
        System.out.println("Beetle constructor");
        Beetle beetle = new Beetle();
    }

}
